package com.udl.emailfs.file;

import java.util.*;
import java.io.Serializable;

/**
 * 
 * @author Edin Guermas Argiles
 */

public class CNode implements Serializable {

	private static final long serialVersionUID = -7024320754033648615L;

	// Clase que contiene la estructura de un C-Nodo
	public class Block implements Serializable {
		private static final long serialVersionUID = -3341592896056673601L;
		
		public String idmail;
		public String acount;

		public Block() {
			idmail = "";
			acount = "";
		}
	}

	public class permsUser implements Serializable {
		
		private static final long serialVersionUID = -5713992040838839877L;
		
		public String idUser;
		public String perm;

		public permsUser() {
			idUser = "";
			perm = "";
		}
	}

	// public class file {
	// public long id;
	// public String name;
	//
	// public file ()
	// {
	// id=0;
	// name="";
	// }
	// }

	public String id;
	public String name;
	public long size;
	public int idOwner;
	public int idOwnerGroup;
	public permsUser permsusers[];
	public Calendar dateCreate;
	public Calendar dateAccess;
	public String fileType;
	public Block paralelBlocks[];
	public Block consecutiveBlocks[];
	public String files[];

	public CNode() {
		int i = 0;
		id = "";
		name = "";
		size = 0;
		idOwner = 0;
		idOwnerGroup = 0;
		permsusers = new permsUser[4];
		dateCreate = Calendar.getInstance();
		dateAccess = Calendar.getInstance();
		fileType = "";
		paralelBlocks = new Block[100];
		consecutiveBlocks = new Block[1000];
		files = new String[10];

		while (i < permsusers.length) {
			permsusers[i] = new permsUser();
			i++;
		}

		i = 0;

		while (i < paralelBlocks.length) {
			paralelBlocks[i] = new Block();
			i++;
		}

		i = 0;

		while (i < consecutiveBlocks.length) {
			consecutiveBlocks[i] = new Block();
			i++;
		}

		i = 0;

		while (i < files.length) {
			files[i] = "";
			i++;
		}
	}
}
